<template>
  <div class="box">我是子组件BBBBBBBB---{{ num }}</div>
</template>
<script>
export default {
  data () {
    return {
      num: 0
    }
  },
  mounted () {
    // 监听
    this.$bus.$on('atob', str => {
      this.num = str
      console.log(str)
    })
  },
  beforeDestroy () {
    this.$bus.$off('atob')
  }
}
</script>
<style scoped>
.box {
  width: 300px;
  height: 300px;
  background-color: #00f;
  color: #fff;
}
</style>
